Skip to content

No-sound on in game sleep / resume fix attempt#323

Closed
ro8inmorgan wants to merge 6 commits intomainfrom
soundbugfix
Closed

No-sound on in game sleep / resume fix attempt#323
ro8inmorgan wants to merge 6 commits intomainfrom
soundbugfix

Conversation

@ro8inmorgan
Copy link
Collaborator

Expiriencing this bug myself finally I got to take a look at the logs when this happens. The only real hint I could find searching through all the logs was the following line

ERROR: ALSA write failed (unrecoverable): File descriptor in bad state

Which seemed to be happening somewhere in the suspend script. Looking over this script I noticed 2 things first the alsa store/restore commands

alsactl --file "$asound_state_dir/asound.state.post" store || true

I get why they are here, but I wonder if they are really needed. It looks like the internal firmware is already handling this properly so I'm not sure if we really need to do this. Disabling these commands made no difference and sleeping resuming has no noticable changes with our without these commands. Sound still restores at the same volume so yeah.

However disabling these commands unfortunately did not resolve the bug as after a couple of sleep resume tries I still got the bug, so I looked into it a bit further and than I realize the resume part of the script was running backgrounded. The reason why is commented as

Resume services in background to reduce UI latency

But this means when you resume directly back into the game it will run nextarch while the resume stuff is still running which my suspicion is that it could be the game will start running even before the sound driver is ready to accept sound.

I've run now a couple of tests sleeping/resuming with running after() normally without backgrounding. Firstly I really see no difference at all in resume speed, but second I did not expirience the no-sound bug yet. So I think this might resolve the issue. But yeah it def needs more testing as this is a very random bug happening very inconsistently as its probably something being timing dependent. But for now I got high hopes on that this solves the issue. But lets do some more testing maybe involving some users before we merge this.

@ben16w
Copy link

ben16w commented May 15, 2025

@ro8inmorgan I've got a PR open which makes some changes to the suspend script (#314). Might be worth merging them together into one PR?

@ro8inmorgan
Copy link
Collaborator Author

Continueing this on #314

@frysee frysee deleted the soundbugfix branch February 19, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants